<template>
    <div>
        <h3>-Child-</h3>
        <button @click="fn(2)">{{num}}</button>

        {{userName}}||{{age}}
        <button @click="fn2">v-bind.sync</button>
    </div>
</template>

<script>
import Son from "@/components/Son.vue";

export default {
    name: "Child",
    components: {
        Son
    },
    props:['num','userName','age'],
    methods: {
        fn(no) {
            this.$emit('update:num',this.num+no)
        },
        fn2(){
            this.$emit('update:userName','李四')
            this.$emit('update:age',38)
        }
    }
}
</script>